<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>奖励提现</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no" />
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="stylesheet" href="../css/base.css" />
    <link rel="stylesheet" href="../css/zhifu.css">
    <link rel="stylesheet" href="../css/tixian.css" />
    <script src="../js/jquery-2.2.3.min.js"></script>
    <script type="text/javascript" src="../js/rem.js"></script>
    <script src="../js/vue.min.js"></script>
    <script src="../js/vue-resource.min.js"></script>
    <script src="../js/common.js"></script>
    <style>
        .tixian_inp {
            border-bottom: 1px solid #CCCCCC !important;
            margin-top: .15rem;
            font-size: .18rem;
        }

        .tixian_btn {
            margin: .27rem auto;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="header">
            <a href="javascript:history.back(-1)"><img src="../img/g_next.png" alt="" /></a>
            奖励提现
        </div>
        <div class="tixian_main">
            <div class="tixian_fangShi" onclick="window.location.href='bankCard_jiangli.html'">
                <!--<img class="FS" src="../img/g_tixian_wx.png" alt="" />-->
                <div class="name">
                    <p class="two">{{yinhangka}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{yinhangka2}}</p>
                </div>
                <img class="right" src="../img/icon-right.png" alt="" />
            </div>
            <div class="tixian_jinE">
                <p class="tixian_TS">请输入提现金额</p>
                <input class="tixian_inp" type="text" placeholder="￥" />
                <!--<p class="tixian_XZ">本次可提现{{money}}元<span @click="cashWithdrawal">全部提现</span></p>-->
                <!--<p class="tixian_XZ">本次可提现{{money}}元<span @click="cashWithdrawal">全部提现</span></p>-->
            </div>
        </div>
        <!--<p class="tixian_DZ">提现免手续费，预计1-3个工作日到账</p>-->
        <input type="button" value="下一步" class="tixian_btn" />
        <!--浮动层-->
        <div class="ftc_wzsf">
            <div class="srzfmm_box">
                <div class="qsrzfmm_bt clear_wl">
                    <img src="../img/xx_03.jpg" class="tx close fl">
                    <span class="fl">请输入支付密码</span></div>
                <div class="zfmmxx_shop">
                    <div class="mz"></div>
                    <div class="zhifu_price"></div>
                </div>
                <ul class="mm_box">
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
            </div>
            <div class="numb_box">
                <div class="xiaq_tb" style="height: 0.2rem;clear: both;">
                    <img src="../img/jftc_14.jpg" style="height: 0.1rem;float: left;margin-left: 46%;">
                </div>
                <ul class="nub_ggg">
                    <li><a href="javascript:void(0);" class="zf_num">1</a></li>
                    <li><a href="javascript:void(0);" class="zj_x zf_num">2</a></li>
                    <li><a href="javascript:void(0);" class="zf_num">3</a></li>
                    <li><a href="javascript:void(0);" class="zf_num">4</a></li>
                    <li><a href="javascript:void(0);" class="zj_x zf_num">5</a></li>
                    <li><a href="javascript:void(0);" class="zf_num">6</a></li>
                    <li><a href="javascript:void(0);" class="zf_num">7</a></li>
                    <li><a href="javascript:void(0);" class="zj_x zf_num">8</a></li>
                    <li><a href="javascript:void(0);" class="zf_num">9</a></li>
                    <li><a href="javascript:void(0);" class="zf_empty">清空</a></li>
                    <li><a href="javascript:void(0);" class="zj_x zf_num">0</a></li>
                    <li><a href="javascript:void(0);" class="zf_del">删除</a></li>
                </ul>
            </div>
            <div class="hbbj"></div>
        </div>
    </div>

</body>
<script>
    $(function () {
        // $('.tixian_fangShi').click(function(){
        // 	$('.overlay').show();
        // 	$('.tixian_FS_XZ').show();
        // });
        var _lv = 0.1;
        $('.tixian_XZ1 span').text(_lv * 100 + '%');
        $('.tixian_btn').click(function () {
            var ze = parseInt(localStorage.getItem('jianglizonge'));
            if (parseInt($('.tixian_inp').val()) == 0) {
                alert('提现金额不允许为0')
            } else if (parseInt($('.tixian_inp').val()) == '') {
                alert('提现金额不允许为空')
            } else if (parseInt($('.tixian_inp').val()) <= ze) {
                $('.ftc_wzsf').show();
            } else {
                alert('可提现余额不足');
            }

        });
        $('.tixian_inp').blur(function () {
            var _val = $(this).val();
            var sxf = _val * _lv;
            var num = _val - sxf;
            $(this).text(num);
        });
        $('.close').click(function () {
            $('.ftc_wzsf').hide();
        })


    })
</script>
<script>
    var _idi = '';
    var app = new Vue({
        el: '#app',
        data: {
            list: [],
            yinhangka: '',
            yinhangka2: '',
            yinhangka3: '',
            money: '',
            cash: '',
            bankCardId: '',
        },
        mounted() {

            var money = decodeURIComponent(getQueryString("money"));
            this.money = money
            var getUrl = GetRequest();
            console.log(getUrl.bankCardId)
            if (getUrl.hasOwnProperty('bankCardId')) {
                this.$http.get(SURL + '/api/xlsusersbankcards/getBankById?bankCardId=' + getUrl.bankCardId, {
                    emulateJSON: true
                }).then(function (res) {
                    console.log(res.body);
                    this.yinhangka = res.body.data.usersBankcard.accNo;
                    this.yinhangka2 = res.body.data.usersBankcard.bankName;
                    _idi = res.body.data.usersBankcard.bankCardId;
                })
            } else {
                this.yinhangka = '';
                this.yinhangka2 = '请选择银行卡';
                this.yinhangka3 = '';
            }
        },
        methods: {
            tixian_FS_XZ_li: function (event) {
                var _th = event.target
                console.log($(_th).find('span').html())
                // console.log($(_th).data('id'));
                if (!$(_th).data('id')) {
                    this.bankCardId = $(_th).parents('.tixian_FS_XZ_li').data('id')
                } else {
                    this.bankCardId = $(_th).data('id')
                }
                // if(!$(_th).find('span').html()){
                //    this.yinhangka = $(_th).parents('.tixian_FS_XZ_li').find('span').html();
                // }else {
                //    this.yinhangka = $(_th).html();
                // }
                $('.overlay').hide();
                this.yinhangka = $(_th).find('span').html();
                console.log(this.yinhangka)
            },
            cashWithdrawal: function () {
                this.cash = this.money
            }
        }
    })

    function GetRequest() {
        //获取url中"?"符后的字串
        var url = location.search;
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }
</script>
<script>
    $(function () {
        // //出现浮动层
        // $(".TJ_btn").click(function () {
        //     $(".ftc_wzsf").show();
        // });
        //关闭浮动
        $(".close").click(function () {
            $(".ftc_wzsf").hide();
            $(".mm_box li").removeClass("mmdd");
            $(".mm_box li").attr("data", "");
            i = 0;
        });
        //数字显示隐藏
        $(".xiaq_tb").click(function () {
            $(".numb_box").slideUp(500);
        });
        $(".mm_box").click(function () {
            $(".numb_box").slideDown(500);
        });
        //----
        var i = 0;
        $(".nub_ggg li .zf_num").click(function () {
            if (i < 6) {
                $(".mm_box li").eq(i).addClass("mmdd");
                $(".mm_box li").eq(i).attr("data", $(this).text());
                i++
                if (i == 6) {
                    //   setTimeout(function(){
                    var data = "";
                    $(".mm_box li").each(function () {
                        data += $(this).attr("data");
                    });
                    console.log(data);
                    $.ajax({
                        url: SURL + '/api/xlsusersdraws/destoonFinanceCash',
                        type: 'POST',
                        data: {
                            userId: localStorage.getItem('userId'),
                            bankCardId: _idi,
                            cash: $('.tixian_inp').val(),
                            type: 5,
                            paypassword: data
                        },
                        success: function (res) {
                            if (res.status == 1) {
                                localStorage.setItem('xfje2', $('.tixian_inp').val());
                                window.location.href = 'xianjintixianjieguo.html';
                            } else {
                                alert(res.msg);
                                $('.ftc_wzsf').hide();
                            }
                        }
                    })
                };
            }
        });
        $(".nub_ggg li .zf_del").click(function () {
            if (i > 0) {
                i--
                $(".mm_box li").eq(i).removeClass("mmdd");
                $(".mm_box li").eq(i).attr("data", "");
            }
        });
        $(".nub_ggg li .zf_empty").click(function () {
            $(".mm_box li").removeClass("mmdd");
            $(".mm_box li").attr("data", "");
            i = 0;
        });
    })
</script>

</html>
